home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr09 / vstsrc.zip / VSTTYPE.H < prev    next >
C/C++ Source or Header  |  1995-01-23  |  14KB  |  343 lines

  1. #ifndef _VSTTYPE_H
  2. #define _VSTTYPE_H
  3.  
  4. /*
  5.  * %W% %E% %U%  [EXTREL_1.2]
  6.  *
  7.  * VersaTrack orbit calculations are based on those that appear in Dr. Manfred
  8.  * Bester's sattrack program (the Unix(tm) versions 1 and 2).
  9.  *
  10.  * The data from which the maps where generated come from "xsat", an
  11.  * X-Windows program by David A. Curry (N9MSW).
  12.  *
  13.  * Site coordinates come from various sources, including a couple of
  14.  * World Almanacs, and also from both of the programs mentioned above.
  15.  *
  16.  * The following are authors' applicable copyright notices:
  17.  *
  18.  *                                                                               
  19.  * Copyright (c) 1992, 1993, 1994 Manfred Bester. All Rights Reserved.        
  20.  *                                                                           
  21.  * Permission to use, copy, modify, and distribute this software and its      
  22.  * documentation for educational, research and non-profit purposes, without   
  23.  * fee, and without a written agreement is hereby granted, provided that the  
  24.  * above copyright notice and the following three paragraphs appear in all    
  25.  * copies.                                                                    
  26.  *                                                                              
  27.  * Permission to incorporate this software into commercial products may be    
  28.  * obtained from the author, Dr. Manfred Bester, 1636 M. L. King Jr. Way,     
  29.  * Berkeley, CA 94709, USA.                                                   
  30.  *                                                                             
  31.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,  
  32.  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF    
  33.  * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED   
  34.  * OF THE POSSIBILITY OF SUCH DAMAGE.                                         
  35.  *                                                                             
  36.  * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT       
  37.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A    
  38.  * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"       
  39.  * BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,  
  40.  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.                                   
  41.  *                                                                             
  42.  *                                                                             
  43.  * Copyright 1992 by David A. Curry                                            
  44.  *                                                                             
  45.  * Permission to use, copy, modify, distribute, and sell this software and its 
  46.  * documentation for any purpose is hereby granted without fee, provided that  
  47.  * the above copyright notice appear in all copies and that both that copyright
  48.  * notice and this permission notice appear in supporting documentation.  The  
  49.  * author makes no representations about the suitability of this software for  
  50.  * any purpose.  It is provided "as is" without express or implied warranty.   
  51.  *                                                                             
  52.  * David A. Curry, N9MSW                                                       
  53.  * Purdue University                                                           
  54.  * Engineering Computer Network                                                
  55.  * 1285 Electrical Engineering Building                                        
  56.  * West Lafayette, IN 47907                                                    
  57.  * davy@ecn.purdue.edu                                                         
  58.  *                                                                             
  59.  * VersaTrack Copyright (c) 1993, 1994 Siamack Navabpour. All Rights Reserved.
  60.  *
  61.  * Permission is hereby granted to copy, modify and distribute VersaTrack
  62.  * in whole, or in part, for educational, non-profit and non-commercial use
  63.  * only, free of charge or obligation, and without agreement, provided that
  64.  * all copyrights and restrictions noted herein are observed and followed, and
  65.  * additionally, that this and all other copyright notices listed herein
  66.  * appear unaltered in all copies and in all derived work.
  67.  *
  68.  * This notice shall not in any way void or supersede any of the other authors
  69.  * rights or privileges.
  70.  *
  71.  * VersaTrack IS PRESENTED FREE AND "AS IS", WITHOUT ANY WARRANTY OR SUPPORT.
  72.  * YOU USE IT AT YOUR OWN RISK. The author(s) shall not be liable for any
  73.  * direct, indirect, incidental, or consequential damage, loss of profits or
  74.  * other tangible or intangible losses or benefits, arising out of or related
  75.  * to its use. VersaTrack carries no warranty, explicit or implied, including
  76.  * but not limited to those of merchantablity and fitness for a particular
  77.  * purpose.
  78.  *
  79.  * Siamack Navabpour, 12342 Hunter's Chase Dr. Apt. 2114, Austin, TX 78729.
  80.  * sia@bga.com or sia@realtime.com.
  81.  */
  82.  
  83.  
  84. struct tag_mapdata {
  85.     long        m_version;
  86.     long        m_RFU0;                     /* true if part of world map*/
  87.     double        m_minx;                     /* lowest x coordinate        */
  88.     double        m_miny;                     /* lowest y coordinate        */
  89.     double        m_maxx;                     /* highest x coordinate        */
  90.     double        m_maxy;                     /* highest y coordinate        */
  91.     long        m_RFU1[22];                 /* Reserved for future use  */
  92. };
  93.  
  94. typedef struct tag_mapdata  mapdata_t;
  95.  
  96. struct tag_mapsuffix {
  97.      int        ms_x, ms_y;    /* Screen resolution for map    */
  98.      char       *ms_suffix;     /* suffix to add to file name   */
  99. };
  100.  
  101. typedef struct tag_mapsuffix mapsuffix_t;
  102.  
  103. typedef struct tag_site {
  104.     char           *c_name;                    /* name                            */
  105.     char           *c_locale;               /* state or country name        */
  106.     char            c_tzname[4];            /* time zone string             */
  107.     double            c_lat;                    /* latitude, radians            */
  108.     double            c_lng;                    /* longitude, radians           */
  109.     double            c_alt;                    /* elevation, meters            */
  110.     double          c_vecX;                 /* for squint angle calcs.      */
  111.     double          c_vecY;                 /*     "   "      "     "       */
  112.     double          c_vecZ;                 /*     "   "      "     "       */
  113.     double          c_timezone;             /* hours.fractions diff with UTC*/
  114.     int             c_lbid;                 /* item id in the list box      */
  115.     struct tag_site *c_next;                /* ptr to next city in link list*/
  116.     void           *c_adjunct;              /* RFU                          */
  117. } site_t;
  118.  
  119. typedef struct tag_satellite {
  120.     char            s_name[32];             /* satellite name                */
  121.     char            s_epochstr[28];         /* string equivalent of epoch   */
  122.     long            s_satnum;               /* catalog number                */
  123.     long            s_elementset;           /* element set number           */
  124.     long            s_orbitnum;             /* epoch revolution             */
  125.     long            s_beacon;               /* beacon frequency (MHz)       */
  126.     double            s_epochyear;            /* epoch year                   */
  127.     double            s_epochtime;            /* epoch time (julian day & fraction */
  128.     double            s_decayrate;            /* orbit decay rate                */
  129.     double            s_inclination;          /* orbital inclination            */
  130.     double            s_raan;                 /* right ascension                */
  131.     double            s_eccentricity;         /* orbit eccentricity            */
  132.     double            s_argperigee;            /* arg of perigee               */
  133.     double            s_meananomaly;            /* mean anomaly                 */
  134.     double            s_meanmotion;            /* mean motion                  */
  135.     double          s_ephemeristype;        /* what it is                   */
  136.     double          s_dratedot;             /* 2nd time derivate of drag    */
  137.     double          s_bstarcoeff;           /* B-star coefficient           */
  138.     short           s_lbid;                 /* id in the list box           */
  139.     short           s_flags;                /* flags                        */
  140.     long            s_RFU[2];               /* RFU                          */
  141.     struct tag_mode *s_modep;               /* ptr to mode struct if any    */
  142.     struct tag_satellite *s_next;           /* ptr to next entry in the list*/
  143. } satellite_t;
  144.  
  145.  
  146. #define MAXMODES    10
  147.  
  148. typedef struct tag_moderec {
  149.     int         minPhase;
  150.     int         maxPhase;
  151.     char        modeStr[4];
  152. } moderec_t;
  153.  
  154. typedef struct tag_mode {
  155.     char        alias[38];
  156.     double      beacon;
  157.     double      perigeePhase;
  158.     double      maxPhase;
  159.     double      attVecX, attVecY, attVecZ;
  160.     int         nmodes;
  161.     void        *m_adjunct;  /* RFU */
  162.     moderec_t   mds[MAXMODES];
  163. } mode_t;
  164.  
  165. typedef struct tag_mapdata  mapdata_t;
  166.  
  167. typedef struct tag_rotinfo {
  168.     char       rot_name[32];
  169.     char       rot_driver[64];
  170.     int        rot_index;
  171.     struct tag_rotinfo *rot_next;
  172. } rotinfo_t;
  173.  
  174. typedef struct tag_radinfo {
  175.     char       rad_name[32];
  176.     char       rad_driver[64];
  177.     int        rad_index;
  178.     struct tag_radinfo *rad_next;
  179. } radinfo_t;
  180.  
  181. struct tag_trackparams {
  182.     site_t          *sitep;
  183.     satellite_t     *satp;
  184.     char            *satname;
  185.     int              flags;
  186.     int              satnum;
  187.     int              elementset;
  188.     short            launchflag;
  189.     short            orbitfrac;
  190.     int              orbitnum;
  191.     int              phase;
  192.     float            minelevation;
  193.     double           epochday;
  194.     double           inclination;
  195.     double           epochRAAN;
  196.     double           eccentricity;
  197.     double           epochargperigee;
  198.     double           epochmeananomaly;
  199.     double           meananomaly;
  200.     double           trueanomaly;
  201.     double           epochmeanmotion;
  202.     double           decayrate;
  203.     double           epochorbitnum;
  204.     double           beacon;
  205.     double           perigeephase;
  206.     double           maxphase;
  207.     double           semimajoraxis;
  208.     double           RAANprec;
  209.     double           perigeeprec;
  210.     double           reforbit;
  211.     double           sitemat[3][3];
  212.     double           duration;
  213.     double           steptime;
  214.     double           starttime;
  215.     double           stoptime;
  216.     double           timezone;
  217.     double           sidday;
  218.     double           sidtime;
  219.     double           equinox;
  220.     double           lastime;
  221.     double           gastime;
  222.     double           juliandate;
  223.     double           lastjdate;
  224.     double           lastsuntime;
  225.     double           lastprectime;
  226.     double           sunepochtime;
  227.     double           suninclination;
  228.     double           sunRAAN;
  229.     double           sunmeananomaly;
  230.     double           suntrueanomaly;
  231.     double           sundistance;
  232.     double           sunmeanmotion;
  233.     double           suneccentricity;
  234.     double           sunargperigee;
  235.     double           sunazimuth;
  236.     double           sunelevation;
  237.     long             RFU[6];
  238. };
  239.  
  240. typedef struct tag_trackparams  track_t;
  241.  
  242. struct  tag_result {
  243.     double           r_time;
  244.     double           r_range;
  245.     double           r_height;
  246.     double           r_rangerate;
  247.     double           r_av;
  248.     float            r_azimuth;
  249.     float            r_elevation;
  250.     float            r_pelev;
  251.     float            r_lat;
  252.     float            r_long;
  253.     float            r_doppler;
  254.     float            r_pathloss;
  255.     float            r_squint;
  256.     short            r_orbitnum;
  257.     short            r_phase;
  258.     char             r_viswarn;
  259.     char             r_rising;
  260.     char             r_insun;
  261.     char             r_modestr[3];
  262.     long             r_RFU[4];
  263. };
  264.  
  265.  
  266. typedef struct tag_result   result_t;
  267.  
  268.  
  269. struct  tag_selection { 
  270.     int              sl_index;
  271.     track_t         *sl_tp;
  272.     result_t        *sl_rp;
  273.     char             sl_itemp[17*20];
  274.     char             sl_buf[82];
  275.     HWND             rtdhwnd;
  276.     HANDLE           rtd_thread_handle;
  277.     double           simtime;
  278.     short            satx;
  279.     short            saty;
  280.     short            dsatx;
  281.     short            dsaty;
  282. #ifndef NOVISCIR
  283.     short            satavx, satavy;
  284.     short            dsatavx, dsatavy;
  285. #endif
  286.     short            ticks;
  287.     short            updatetime;
  288.     int              timerid;
  289.     char             timeron, terminate, first, running;
  290.     int              flags;
  291.     CRITICAL_SECTION rtd_mutex;
  292.     long             RFU[4];
  293.     struct tag_selection *sl_next;
  294. };
  295.  
  296. typedef struct tag_selection select_t;
  297.  
  298. struct tag_reginfo {
  299.     char    *ri_msgstring;
  300.     char    *ri_basekey;
  301.     char    *ri_subkey1;
  302.     char    *ri_subkey2;
  303.     char    *ri_subkey3;
  304.     char    *ri_username;
  305. };
  306.  
  307. typedef struct tag_reginfo reginfo_t;
  308.  
  309. struct tag_registry {
  310.     char            *st_message;
  311.     char            *st_default;
  312.     char            *st_keyvalue;
  313.     int              st_maxkeylen;
  314.     int              st_keylen;
  315.     char            *st_keyname;
  316.     int              st_keytype;
  317. };
  318.  
  319. typedef struct tag_registry registry_t;
  320.  
  321.  
  322. typedef struct tag_exserver {
  323.     char       *srv_libfun;
  324.     char       *srv_pipename;
  325.     int         srv_state;
  326.     int         srv_flags;
  327.     int         srv_seq;
  328.     select_t   *srv_sp;
  329.     void       *srv_vp;
  330.     HANDLE      srv_thread_handle;
  331.     HANDLE      srv_hpipe;
  332.     HANDLE      srv_RdEvent;
  333.     HANDLE      srv_WrEvent;
  334.     OVERLAPPED  srv_RdOverlap;
  335.     OVERLAPPED  srv_WrOverlap;
  336.     void        (*srv_fmtproc)(int, int, struct tag_exserver *,
  337.                  select_t *, char *);
  338.     void       *srv_adjunct;    /* RFU */
  339. } exserver_t;
  340.  
  341.  
  342. #endif /* _VSTTYPE_H */
  343.